//
// Created by 86131 on 2023/9/11.
//
#include <iostream>
#include <stdio.h>
using namespace std;
typedef int ElementType;
typedef struct Node *PtrToNode;
struct Node {
    ElementType Data;//存储结点数据
    PtrToNode   Next = nullptr;//指向下一个结点的指针
};
typedef PtrToNode List;//定义单链表类型;
List Read(); /* 细节在此不表 */
void Print( List L ); /* 细节在此不表；空链表将输出NULL */
int Length(List L);
List Find(List L,ElementType X);
int main()
{
    List L1, L2, L;
    L1 = Read();
    Print(L1);
    return 0;
}
List Read(){
    int n;//
    cin>>n;//输入要读入的数据个数
    List first  = (List)malloc(sizeof (List)) ;
    Node *node_temp = new Node;

    for(int i=0;i<n;i++){
        Node *node = new Node;
        cin>>node->Data;
        //cout<<1;//1
        if(i==0){first->Next=node;node_temp = node;}else
        {
            node_temp->Next = node;
            node_temp = node;
        }
    }
    return first;
}
void Print(List L){
    if(L== nullptr){cout<<"NULL";
        return;}
    L = L->Next;
    while(L!=nullptr){
        cout<<L->Data<<" ";
        L= L->Next;
    }

}
int Length(List L){
    Node *node_temp = new Node;
    node_temp = L->Next;
    int c=0;
    if(node_temp==nullptr){
        return c;}
    while(node_temp!=nullptr){
        cout<<c;
        node_temp= node_temp->Next;
        c++;
    }
    return c;
}
List Find(List L,ElementType X){
    List p = L;
    while(p&&p->Data!=X)
        p = p->Next;
    if(p)
        return p;
    else
        return nullptr;
}